import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Vector;




public class host {
	
	// basic member info
	private String name;
	private int memberID;
	private int phone;
	private int age;
	private String gender;
	private String idType;
	private String id;
	// room info
	private int roomNum;
	private Calendar startTime;
	private String amount;
	private int totalMin;
	private double money;
	private String records;
	private Calendar endTime;
	
	
	public host(String initName, int initMemberID, int initPhone, int initAge,
			String initGender, String initIdType, String initId, String initAmount,
			int initTotalMin){
		name = initName;
		memberID = initMemberID;
		phone = initPhone;
		age = initAge;
		gender = initGender;
		idType = initIdType;
		id = initId;	
		roomNum = -1;
		startTime = null;
		amount = initAmount;
		money = 0;
		totalMin = initTotalMin;
		records = "";
		endTime = null;
	}
	
	public void setName(String initName) 				 {name = initName;}
	public void setMemberID(int initMemberID)			 {memberID = initMemberID;}
	public void setPhone(int initPhone)					 {phone = initPhone;}
	public void setAge(int initAge)						 {age = initAge;}
	public void setGender(String initGender)			 {gender = initGender;}
	public void setIdType(String initIdType)			 {idType = initIdType;}
	public void setId(String initId)					 {id = initId;}
	public void setRoomNum(int initRoomNum) 			 {roomNum = initRoomNum;}
	public void setStartTime(Calendar initStartTime)	 {startTime = initStartTime;}
	public void setAmount(String initAmount)		 	 {amount = initAmount;}
	public void setMoney(double initMoney)		 		 {money = initMoney;}
	public void setTotalMin(int initTotalMin)		 	 {totalMin = initTotalMin;}
	public void addRecords(String initRecord)			 {records += initRecord+"\n";}
	
	public void setEndTime(Calendar time, int mins){
		endTime = (Calendar) time.clone();
		endTime.add(Calendar.MINUTE, mins);
	}
	
	
	public String getName() 				{return name;}
	public int 	getMemberID()				{return memberID;}
	public int getPhone()			 		{return phone;}
	public int getAge()						{return age;}
	public String getGender()			 	{return gender;}
	public String getIdType()			 	{return idType;}
	public String getId()					{return id ;}
	public int getRoomNum()		 			{return roomNum;}
	public Calendar getStartTime()		 	{return startTime;}
	public String getAmount()		 		{return amount;}
	public double getMoney()		 		{return money;}
	public int getTotalMin()		 		{return totalMin;}
	public String getRecords()				{return records;}
	public Calendar getEndTime()			{return endTime;}
	
	public String toString(){
		DateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm");
		String s = "";
		s+="Host Name: "+getName()+"\n";
		s+="Member ID: "+getMemberID()+"\n";
		s+="Room: "+getRoomNum()+"\n";
		s+="Phone: "+getPhone()+"\n";
		s+="Gender: "+getGender()+"\n";
		s+="Age: "+getAge()+"\n";
		s+=getIdType()+": "+getId()+"\n";
		s+="People Amount: "+getAmount()+"\n";
		s+="Start Time: "+format.format(getStartTime().getTime())+"\n";
		s+="Total Minutes: "+getTotalMin()+"\n";
		s+="End Time: "+format.format(getEndTime().getTime())+"\n";
		s+="Records: "+getRecords()+"\n";
		s+="Cost: "+getMoney()+"\n";
		return s;
	}
	
	// check whether the time is in the occupied period
	public boolean in(Calendar c){
		if (getName().equals(""))
			if (c.compareTo(getStartTime()) >= 0 && c.compareTo(getEndTime()) <= 0)
				return true;
		return false;
	}
	
}
